<template>
	<view class="">
		<view class="list" v-if="routeList.length!=0">
			<view class="list-msg dis" v-for="(item,index) in routeList" :key="index"
				@click="goPage('/pagesA/qualityRoutes/info?id='+item.id)">
				<view class="list-msg-img">
					<image :src="item.image" mode=""></image>
				</view>
				<view class="list-msg-msg dis">
					<view class="list-msg-msg-left">
						{{item.title}}
					</view>
					<view class="list-msg-msg-center">
						<text v-for="(items,index) in item.tags">{{items}}</text>

					</view>
					<view class="list-msg-msg-bom">
						<text>查看线路</text>
					</view>
				</view>
			</view>
		</view>
		<view v-else>
			<noData></noData>
		</view>
<home></home>
	</view>
</template>

<script>
	import home from '@/components/home/index.vue'
	import noData from '@/components/com/noData.vue'
	import {
		getRouteList
	} from '@/api/togeterRich/index.js'
	export default {
		components: {
			noData,
			home
		},
		data() {
			return {
				routeList: []
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			init() {
				getRouteList().then(res => {
					this.routeList = res.data.list

					console.log(res, 'ds')
				})
			},
			goPage(url) {
				uni.navigateTo({
					url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.list {
		width: 100%;

		.list-msg {
			.list-msg-msg-bom {
				text-align: right;

				text {
					background: $maincolor;
					border-radius: 60px 60px 60px 60px;
					opacity: 1;
					color: #fff;
					padding: 7rpx 11rpx;
				}

			}

			.list-msg-msg {
				flex-direction: column;
				justify-content: space-between;
				width: 67%;

				.list-msg-msg-center {
					text {
						border-radius: 100rpx;
						font-size: 22rpx;
						padding: 7rpx 11rpx;

						margin-right: 10rpx;
						border: 1rpx solid $maincolor;
					}
				}

				.list-msg-msg-left {
					overflow: hidden;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-line-clamp: 2;
					/* 限制在三行 */
					-webkit-box-orient: vertical;
					font-size: 28rpx;
				}
			}

			.list-msg-img {
				width: 200rpx;
				height: 200rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}

			margin-bottom: 20rpx;
			background: #fff;
			padding: 30rpx;
			justify-content: space-between;
			height: 250rpx;
		}
	}
</style>